//
//  BrandSetModel.m
//  Auction
//
//  Created by Gary on 15/7/18.
//  Copyright (c) 2015年 Lebo. All rights reserved.
//

#import "BrandSetModel.h"

@implementation BrandSetModel

- (id)copyWithZone:(NSZone *)zone {
    BrandSetModel *copy = [super copyWithZone:zone];
    if (copy) {
        copy._id = self._id;
        copy.extCode = self.extCode;
        copy.modelName = self.modelName;
        copy.brandName = self.brandName;
        copy.brandId = self.brandId;
    }
    return copy;
}

static NSString *tName = @"t_car_model";

+ (NSString *)tableName {
    return tName;
}

static NSDictionary *propertyDictionary = nil;

+ (NSDictionary *)propertyDictionary {
    static dispatch_once_t onceToken;
    
    dispatch_once(&onceToken, ^{
        NSMutableDictionary *dic = [[NSMutableDictionary alloc] initWithDictionary:[super propertyDictionary]];
        AddProperty(@"extCode",     PDTString,            @"extCode");
        AddProperty(@"modelName",      PDTString,            @"modelName");
        AddProperty(@"brandName",        PDTString,            @"brandName");
        AddProperty(@"brandId",        PDTString,            @"brandId");
        propertyDictionary = [NSDictionary dictionaryWithDictionary:dic];
    });
    
    return propertyDictionary;
}

+ (NSString *)sql {
    static NSString *sql = nil;
    if (nil == sql) {
        sql = [NSString stringWithFormat:@"create table %@ (id integer primary key autoincrement, extCode text, modelName text, brandName text, brandId text)", tName];
    }
    return sql;
}

- (NSDictionary *)dictionaryOfPropertyAndValue {
    return [BaseModel dictionaryOfpropertyAndValueWithClass:self deep:2];
}

@end
